
<div style="padding:30px;">



  <?php 
 // print_r($finYears);
  $month= array('1'=>"Jan",'2'=>"Feb",'3'=>"Mar",
		               '4'=>"Apr",'5'=>"May",'6'=>"Jun ",
					   '7'=>"Jul",'8'=>"Aug",'9'=>"Sep",
					   '10'=>"Oct",'11'=>"Nov",'12'=>"Dec"
					   ); 
  
  if(!empty($payment))
  {
	  ?>
      <table>
      <tr>
      <td>
     <b> Name </b>
      </td> <td> <?php echo $staff['first_name'];?> &nbsp; <?php echo $staff['last_name'];?>  </td>
     </tr>
     <tr>
      <td>
      <b> Staff code </b>
      </td>
      <td>
      <?php echo $staff['staff_code'];?>
      </td>
      </tr>
      <tr>
      <td>
      <b> Designation </b>
      </td>
      <td>
      <?php echo $staff['designation'];?>
      </td>
     </tr>
     <tr>
      <td>
       <b> Year </b>
      </td>
      <td>
        <?php echo $fy['name']; ?>
      </td>
      
      </tr>
      <tr>
      <td>
      <b> Month </b>
      </td>  
      <td>
      
       <?php
	   $m= $payment['month'];
	    echo $month[$m]; ?>
      </td>
      </tr>
      
       <tr>
      <td>
     <b> Basic Pay </b>
      </td>
       <td>
      <?php 
	  echo $payment['basic_pay'];
	   ?>
      </td>
      </tr>
      
      <tr>
      <td>
        <b>Dearness Allowance Type  </b>
      </td>
       <td>
      <?php 
	  echo $payment['da_type'];
	   ?>
      </td>
      </tr>
      <tr>
      <td>
     
		<b> Dearness Allowance </b>
      </td>
      <td>
      <?php 
	  echo $payment['da_amount'];
	   ?>
      </td>
      </tr>
      <tr>
      <td> <b>
      House Rent Allowance Type </b>
      </td>
       <td>
      <?php 
	  echo $payment['hra_type'];
	   ?>
      </td>
      </tr>
      <tr>
      <td>
      <b> House Rent Allowance </b>
      </td>
      <td>
      <?php 
	  echo $payment['hra_amount'];
	   ?>
      </td>
      </tr>
    
      <tr>
      <td>
      <b>Total </b>
      </td>
       <td>
      <?php 
	  echo $payment['total'];
	   ?>
      </td>
      </tr>
      <tr>
      <td>
     <b> Provident Fund </b>
      </td>
       <td>
      <?php 
	  echo $payment['pf_amount'];
	   ?>
      </td>
      </tr>
      <tr>
      <td>
     <b>Life Insurance Deduction </b>
      </td>
      <td>
      <?php 
	  echo $payment['life_insurance'];
	   ?>
      </td>
      </tr>
      <tr>
      <td>
    <b>Misc Recoveries </b>
      </td>
       <td>
      <?php 
	  echo $payment['misc_recoveries'];
	   ?>
      </td>
      </tr>
      <tr>  
       
        <tr>
      <td>
   
		<b>Net amount paid  </b>
      </td>
       <td>
      <?php 
	  echo $payment['net_amount_paid'];
	   ?>
      </td>
      </tr>
      
      <tr>
      
      <td>
   
       <b> Remarks </b>
      </td>
      <?php 
	  echo $payment['remark'];
	   ?>
      </td>
      </tr>
      <tr>
      
      <td>
   
       <b> Paid Date </b>
      </td>
      <td>
   
      <?php 
	  echo $payment['updated'];
	   ?>
      </td>
      </tr>
      <tr>  
      
      <tr>  
      </tr>
      </table>
      <?php
  }
  else
  {
  if(!empty($salary)) { ?>
 <form action="<?= $admin_base_url; ?>staff/Paysalary/<?=$id;?>/<?php echo $cur_page;?>" method="post" id="staff_form">
 <?php } else { ?>
 <form action="<?= $admin_base_url; ?>staff/Paysalary/<?=$id;?>/<?=$cur_page;?>" method="post" id="staff_form">
 <?php } ?>
 

    

		<label> Name </label>
        <input type="hidden" value="<?php echo $id; ?>" name="staff_id"/>
		<?php echo $staff['first_name'];?> &nbsp; <?php echo $staff['last_name'];?><br/><br/>

    	
         <label><?php echo getLangText('staff_staff_code',$this); ?> </label><?php echo $staff['staff_code'];?> <br/><br/>
	       
		<label> <?php echo getLangText('staff_designation',$this); ?></label>
		 <?php echo $staff['designation'];?><br/><br/>
         
          <label>Year </label>   <select class="txt1" name="financial_year"> 
		  													<?php 
															foreach($finYears as $row)
															  {
																  echo "<option ";
																  if($fy['id']== $row['id'])
																  echo "selected ";
																  echo "value=".$row['id'].">". $row['name'] ."</option>";
															  }
		                                                       ?> </select> <br/><br/>
        <label> Month </label> 
        <?php 
		
		$current_month= date('m');
		$previous_month= $current_month-1;
		if($current_month=='12')
		{
			$previous_month=1;
		}
		//echo $previous_month;
		?>
        
         <select class="txt1" name="month"> 
        <option value="">  Select Month </option>
        <?php 
		foreach($month as $key=>$val)
		{
			echo "<option ";
			if($key==$previous_month)
			{
				echo "selected";
			}
			echo " value=".$key.">".$val."</option>";
		}
		 ?>
        
          </select> <br/><br/>
	
    	<label><?php echo getLangText('staff_basic_pay',$this); ?></label>
		<input class="txt1" type="text" id="basic" name="basic_pay" value="<?php echo $salary['basic_pay'];?>"/> <br/>
        
       
        
        <label> <?php echo getLangText('staff_sal_da_type',$this); ?></label>
        <select name="da_type" class="txt1" id="da_type">
        <option value="">Select </option>
        <option value="amount" <?php if($salary['da_type']=='amount') echo "selected"; ?>> Amount </option>
        <option value="percent" <?php if($salary['da_type']=='percent') echo "selected"; ?>> Percent </option>
        
		</select> <br/>
    
		<label> <?php echo getLangText('staff_sal_da',$this); ?></label>
		<input class="txt1" type="text" id="da_amount" name="da_amount" value="<?php echo $salary['da_amount'];?>"/> <br/>
	<br/>
    
    <label> <?php echo getLangText('staff_sal_hra_type',$this); ?></label>
        <select name="hra_type" id="hra_type" class="txt1">
        <option value="">Select </option>
        <option value="amount" <?php if($salary['hra_type']=='amount') echo "selected"; ?>> Amount </option>
        <option value="percent" <?php if($salary['hra_type']=='percent') echo "selected"; ?>> Percent </option>
        
		</select> <br/>
		<label> <?php echo getLangText('staff_sal_hra',$this); ?></label>
		<input class="txt1" type="text" id="hra_amount" name="hra_amount" value="<?php echo $salary['hra_amount'];?>"/> <br/>		
         <br/>
	
    
		<label> <?php echo getLangText('staff_sal_oa',$this); ?></label>
		<input class="txt1" type="text" id="other_allowance" name="other_allowance" value="<?php echo $salary['other_allowance'];?>"/> <br/>
        
		<label> <?php echo getLangText('staff_sal_total',$this); ?></label>
		<input class="txt1" type="text" id="total" name="total" value="<?php echo $salary['total'];?>" onClick="Sum()"/> <br/>
	<br/>
    
	<label> <?php echo getLangText('staff_sal_pf',$this); ?></label>
		<input class="txt1" type="text" id="pf_amount" name="pf_amount" value="<?php echo $salary['pf_amount'];?>"/> <br/>
	
    <label> <?php echo getLangText('staff_sal_lid',$this); ?></label>
		<input class="txt1" type="text" id="life_insurance" name="life_insurance" value="<?php echo $salary['life_insurance'];?>"/> <br/>
   
   <label> <?php echo getLangText('staff_sal_mr',$this); ?></label>
		<input class="txt1" type="text" name="misc_recoveries" id="misc_recoveries" value="<?php echo $salary['misc_recoveries'];?>"/> <br/>
    
		<label><?php echo getLangText('staff_sal_net',$this); ?> </label>
        <input class="txt1" type="text" id="net_amount_paid" name="net_amount_paid" onclick="netAmount()" value="<?php echo $salary['net_amount_paid'];?>"/> <br/>
        
         
        
        <label><?php echo getLangText('staff_sal_remark',$this); ?> </label>
	  <textarea class="txt1" name="remarks" cols="15" rows="2"><?php echo $salary['remarks'];?></textarea><br/>
	
		<label>&nbsp;</label>
		   
			<div class="buttons">
			    <button type="submit" name="save" class="positive" value="save" >
                
			        <img src="<?php echo $admin_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($salary)) { 
 						echo getLangText('staff_pay_salary',$this); 
						?>
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else { 
 					  	 echo getLangText('staff_add_salary',$this); 
 					  	 } ?>

 			    </button>
			   <a href="<?= $admin_base_url; ?>staff/cancel?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $admin_image_path?>icons/cross.png" alt=""/>
			        <?php echo getLangText('staff_cancel_button',$this); ?>
			   </a>
			</div>
		


 </form>
 </div>
 <script type="text/javascript">//<![CDATA[
      Calendar.setup({
        inputField : "f_dob",
        trigger    : "f_dob_button",
        onSelect   : function() { this.hide() },
        showTime   : 12,
        dateFormat : "%Y-%m-%d"
      });
    //]]></script>
 <script>
 $(document).ready(function() {
     $("#staff_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,basic_pay,Please enter name.",
					 
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>
 <?php
  }
 ?>